package org.xy.bean;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;

public class Child {
	private List<String> names;

	public List<String> getNames() {
		return this.names;
	}

	@XmlElement(name = "name")
	public void setNames(List<String> names) {
		this.names = names;
	}

	public boolean hasChild() {
		return this.names == null ? false : this.names.size() > 0;
	}

	public Child() {

	}

	public Child(String[] childNames) {
		if (childNames != null) {
			if (this.names == null) {
				this.names = new ArrayList<String>();
			}

			for (int i = 0; i < childNames.length; i++) {
				this.names.add(childNames[i]);
			}
		}
	}

}
